use crate::model::LibImport;
use serde::Deserialize;

#[derive(Debug, Deserialize)]
pub struct EntryInfo {
    pub package_name: String, // 包名称
    pub name: String,         // 入口名称
}

impl From<EntryInfo> for LibImport {
    fn from(entry_info: EntryInfo) -> Self {
        Self {
            lib_name: entry_info.package_name,
            element_name: entry_info.name,
            ..LibImport::default()
        }
    }
}
impl From<&EntryInfo> for LibImport {
    fn from(entry_info: &EntryInfo) -> Self {
        Self {
            lib_name: entry_info.package_name.clone(),
            element_name: entry_info.name.clone(),
            ..LibImport::default()
        }
    }
}
